package com.chensheng.dao;

import com.chensheng.model.News;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author:ChenSheng
 * @Description:
 * @Date: Created in 下午 13:41 2018/5/14 0014
 */
@Mapper
public interface NewsDAO {

    News findOne(@Param("name") String name);

    List<News> findGroup(@Param("gender") String gender);

    List<News> findListGroup(@Param("genderList") List<String> genderList);

    @Insert({"insert news values (#{name}, #{gender})"})
    void insertOne(@Param("name") String name, @Param("gender") String gender);

    @Select({"select * from news where name = #{name}"})
    News selectOne(@Param("name") String name);

}
